#include <iostream>
#include "thread.hpp"
#include "taskqueue.hpp"
#include "threadpool.hpp"
#include <stdlib.h>
#include <time.h>
#include <memory>
using std::bind;
using std::move;
using namespace std;
class MyTask{
public:
    void process(){
        int temp = rand()%100;
        printf("make a number : %d\n",temp);
    }   

};

void process1(){

        int temp = rand()%10+1;
        printf("process1 make a number : %d\n",temp);
}

int main()
{

    moqi::Threadpool threadpool(4,10);
    threadpool.start();
    srand(time(NULL));
    int cnt = 20;
    while(cnt--){
        printf("add task\n");
//        threadpool.addTask(bind(&MyTask::process,MyTask()));
        threadpool.addTask(process1);
    }
    threadpool.stop();
    printf("main end\n");
    return 0;
}

